[IA64] sparse tree cleanups
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 8 Jun 2006 16:17:22 +0000 (10:17 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 8 Jun 2006 16:17:22 +0000 (10:17 -0600)
 Here's a first pass at some sparse tree cleanups based on feedback
 we've gotten on linux-ia64.  I haven't taken all of the comments into
 account yet, this is just a start.  Specific changes:

  - CONFIG_ARCH_XEN is no longer necessary
  - simple is_running_on_xen() checks can be handled w/o CONFIG_XEN
  - pulled forward a drivers/xen/Makefile change that broken make clean
  - changed some comments from C++ style to C
  - turned HYPERVISOR_ioremap into a macro for !CONFIG_XEN
  - made hypervisor.h and privop.h include-able for !CONFIG_XEN

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
linux-2.6-xen-sparse/arch/ia64/Kconfig
linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c
linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile
linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
linux-2.6-xen-sparse/include/asm-ia64/io.h
linux-2.6-xen-sparse/include/asm-ia64/page.h
linux-2.6-xen-sparse/include/asm-ia64/privop.h
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h

index 763b19ea42d61d17e4e1a6944a0d564c3b8232fb..61a5dd8058f1197bb2124ec9107a9b7f4ac9e535 100644 (file)
@@ -57,13 +57,6 @@ config XEN
          Enable Xen hypervisor support.  Resulting kernel runs
          both as a guest OS on Xen and natively on hardware.
 
-config ARCH_XEN
-       bool
-       default y
-       depends on XEN
-       help
-         TEMP ONLY. Needs to be on for drivers/xen to build.
-
 config XEN_IA64_DOM0_VP
        bool "dom0 vp model"
        depends on XEN
index 549aec51783d80683c7a5f8d33deea381678b01f..d9b11edf96c829a5430f15aa2155f0949a6da86c 100644 (file)
@@ -670,10 +670,8 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
        iosapic_intr_info[vector].dmode    = delivery;
        iosapic_intr_info[vector].trigger  = trigger;
 
-#ifdef CONFIG_XEN
        if (is_running_on_xen())
                return 0;
-#endif
 
        if (trigger == IOSAPIC_EDGE)
                irq_type = &irq_type_iosapic_edge;
@@ -1017,10 +1015,9 @@ iosapic_system_init (int system_pcat_compat)
        }
 
        pcat_compat = system_pcat_compat;
-#ifdef CONFIG_XEN
        if (is_running_on_xen())
                return;
-#endif
+
        if (pcat_compat) {
                /*
                 * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
index b5719e911be391c7f37291267424de0c39a3ba5d..edbc568c07a38dc9cf87aa933a96c761b4d05b51 100644 (file)
@@ -66,11 +66,13 @@ int
 assign_irq_vector (int irq)
 {
        int pos, vector;
+
 #ifdef CONFIG_XEN
-       extern int xen_assign_irq_vector(int);
-       if (is_running_on_xen())
+       if (is_running_on_xen()) {
+               extern int xen_assign_irq_vector(int);
                return xen_assign_irq_vector(irq);
-#endif /* CONFIG_XEN */
+       }
+#endif
  again:
        pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
        vector = IA64_FIRST_DEVICE_VECTOR + pos;
index 171d29b4038b03d78cb49378fca158b0142100f1..cf22c368c943ad22bb9a24f22b106be2e7b28d2b 100644 (file)
@@ -416,6 +416,7 @@ void __init
 setup_arch (char **cmdline_p)
 {
        unw_init();
+
 #ifdef CONFIG_XEN
        if (is_running_on_xen())
                setup_xen_features();
@@ -933,6 +934,7 @@ cpu_init (void)
        /* size of physical stacked register partition plus 8 bytes: */
        __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
        platform_cpu_init();
+
 #ifdef CONFIG_XEN
        /* Need to be moved into platform_cpu_init later */
        if (is_running_on_xen()) {
@@ -940,6 +942,7 @@ cpu_init (void)
                xen_smp_intr_init();
        }
 #endif
+
        pm_idle = default_idle;
 }
 
index 8602c71d3ba280438d1816044082ebdd825b6874..f29434d5ea3cfc2f0534209c6ba58f1b22ada013 100644 (file)
@@ -17,6 +17,5 @@ obj-$(CONFIG_XEN_TPMDEV_BACKEND)      += tpmback/
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)      += blkfront/
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)      += netfront/
 obj-$(CONFIG_XEN_BLKDEV_TAP)           += blktap/
-obj-$(CONFIG_XEN_TPMDEV_FRONTEND)      += tpmfront/
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += pciback/
 obj-$(CONFIG_XEN_PCIDEV_FRONTEND)      += pcifront/
index 7e9279e0f6f6862388a3439bfe2b0ce8a311113b..a4a937915a5a7cf26b8975e4b2fab6c6722f105c 100644 (file)
@@ -8,9 +8,10 @@
 #include <linux/config.h>
 #include <asm/machvec.h>
 #ifdef CONFIG_XEN_IA64_DOM0_VP
-#include <asm/hypervisor.h> //XXX to compile arch/i386/kernel/swiotlb.c
-                            //    and arch/i386/kernel/pci-dma-xen.c
-#include <asm-i386/mach-xen/asm/swiotlb.h> //XXX to compile arch/i386/kernel/swiotlb.c
+/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
+#include <asm/hypervisor.h>
+/* Needed for arch/i386/kernel/swiotlb.c */
+#include <asm-i386/mach-xen/asm/swiotlb.h>
 #endif
 
 #ifndef CONFIG_XEN_IA64_DOM0_VP
@@ -109,7 +110,7 @@ dma_cache_sync (void *vaddr, size_t size, enum dma_data_direction dir)
 #define dma_is_consistent(dma_handle)  (1)     /* all we do is coherent memory... */
 
 #ifdef CONFIG_XEN_IA64_DOM0_VP
-// arch/i386/kernel/swiotlb.o requires
+/* arch/i386/kernel/swiotlb.o requires */
 void contiguous_bitmap_init(unsigned long end_pfn);
 
 static inline int
index cdab2240aa8716e81c25c1947cafe2255cf9730a..e39d90e3a16076ae21f2de8cd0405fb91ebad806 100644 (file)
 #ifndef __HYPERVISOR_H__
 #define __HYPERVISOR_H__
 
+#ifndef CONFIG_XEN
+#define is_running_on_xen()                    (0)
+#define HYPERVISOR_ioremap(offset, size)       (offset)
+#else
+extern int running_on_xen;
+#define is_running_on_xen()                    (running_on_xen)
+#endif
+
+#ifdef CONFIG_XEN
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -46,7 +55,6 @@
 #include <asm/hypercall.h>
 #include <asm/ptrace.h>
 #include <asm/page.h>
-#include <asm/xen/privop.h> // for is_running_on_xen()
 
 extern shared_info_t *HYPERVISOR_shared_info;
 extern start_info_t *xen_start_info;
@@ -192,5 +200,6 @@ MULTI_update_va_mapping(
 asmlinkage int xprintk(const char *fmt, ...);
 #define xprintd(fmt, ...)      xprintk("%s:%d " fmt, __func__, __LINE__, \
                                        ##__VA_ARGS__)
+#endif /* CONFIG_XEN */
 
 #endif /* __HYPERVISOR_H__ */
index 5d59c542dc9a059765b560b151fc8f7de93e6716..bc1ee862724906cacc8818956884017cb2e80039 100644 (file)
@@ -66,15 +66,13 @@ extern unsigned int num_io_spaces;
 #define PIO_RESERVED           __IA64_UNCACHED_OFFSET
 #define HAVE_ARCH_PIO_SIZE
 
+#include <asm/hypervisor.h>
 #include <asm/intrinsics.h>
 #include <asm/machvec.h>
 #include <asm/page.h>
+#include <asm/privop.h>
 #include <asm/system.h>
 #include <asm-generic/iomap.h>
-#ifdef CONFIG_XEN
-#include <asm/privop.h>
-#include <asm/hypervisor.h>
-#endif
 
 /*
  * Change virtual addresses to physical addresses and vv.
@@ -115,11 +113,13 @@ extern int valid_mmap_phys_addr_range (unsigned long addr, size_t *count);
 
 #define page_to_pseudophys(page) \
        ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
-// XXX
-// the following drivers are broken because they use page_to_phys() to
-// get bus address. fix them.
-// drivers/ide/cris/ide-cris.c
-// drivers/scsi/dec_esp.c
+
+/*
+ * Drivers that use page_to_phys() for bus addresses are broken.
+ * This includes:
+ * drivers/ide/cris/ide-cris.c
+ * drivers/scsi/dec_esp.c
+ */
 #define page_to_phys(page)     (page_to_pseudophys(page))
 #define bvec_to_bus(bv)                (page_to_bus((bv)->bv_page) + \
                                (unsigned long) (bv)->bv_offset)
@@ -459,9 +459,7 @@ __writeq (unsigned long val, volatile void __iomem *addr)
 static inline void __iomem *
 ioremap (unsigned long offset, unsigned long size)
 {
-#ifdef CONFIG_XEN
        offset = HYPERVISOR_ioremap(offset, size);
-#endif
        return (void __iomem *) (__IA64_UNCACHED_OFFSET | (offset));
 }
 
index fa06e7f1e4c232d4b0e8ebb336b3a8a8a7fbc242..7d016eabd3ccfdea7d2f023bf2098d47cbc413ce 100644 (file)
@@ -237,10 +237,12 @@ get_order (unsigned long size)
 #include <xen/features.h>      // to compile netback, netfront
 typedef unsigned long maddr_t; // to compile netback, netfront
 
-// XXX hack!
-//     Linux/IA64 uses PG_arch_1.
-//     This hack will be removed once PG_foreign bit is taken.
-//#include <xen/foreign_page.h>
+/*
+ * XXX hack!
+ * Linux/IA64 uses PG_arch_1.
+ * This hack will be removed once PG_foreign bit is taken.
+ * #include <xen/foreign_page.h>
+ */
 #ifdef __ASM_XEN_FOREIGN_PAGE_H__
 # error "don't include include/xen/foreign_page.h!"
 #endif
@@ -272,7 +274,7 @@ extern struct address_space xen_ia64_foreign_dummy_mapping;
 })
 #define HAVE_ARCH_FREE_PAGE
 
-//XXX xen page size != page size
+/* XXX xen page size != page size */
 
 static inline unsigned long
 pfn_to_mfn_for_dma(unsigned long pfn)
@@ -316,7 +318,7 @@ machine_to_phys_for_dma(unsigned long machine)
 #define set_phys_to_machine(pfn, mfn) do { } while (0)
 #define xen_machphys_update(mfn, pfn) do { } while (0)
 
-//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
+/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
 #define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
 
 #define mfn_to_pfn(mfn)                        (mfn)
index c8b8589976507f45de6f94b668fdcf81f9c703c5..28c1e886c03ee8cdc28f78e442baa191c9837c8d 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #ifdef CONFIG_XEN
 #include <asm/xen/privop.h>
 #endif
index cd423016c2f7a9c42c950a44a0b9fc6f7cebeee7..3f1a0ac7622891c9c1f0ee57b8572441c5749343 100644 (file)
@@ -44,9 +44,6 @@
 #endif
 
 #ifndef __ASSEMBLY__
-extern int running_on_xen;
-#define is_running_on_xen() running_on_xen
-
 #define        XEN_HYPER_SSM_I         asm("break %0" : : "i" (HYPERPRIVOP_SSM_I))
 #define        XEN_HYPER_GET_IVR       asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR))